

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>OSD 配置参考 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="mClock Config Reference" href="../mclock-config-ref/" />
    <link rel="prev" title="监视器与 OSD 交互的配置" href="../mon-osd-interaction/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../../">Ceph 存储集群</a> &raquo;</li>
        
          <li><a href="../">配置</a> &raquo;</li>
        
      <li>OSD 配置参考</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../../_sources/rados/configuration/osd-config-ref.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../">
          

          
            
            <img src="../../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../">配置</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../storage-devices/">存储设备</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-conf/">配置 Ceph</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/">通用选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-network-config">网络</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#id3">监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-osd-config">认证</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#osds">OSDs</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#id5">心跳</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-logging-and-debugging">日志记录、调试</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-conf">ceph.conf 实例</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-runtime-config">跑多个集群（已废弃）</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network-config-ref/">网络选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../msgr2/">信使协议 v2</a></li>
<li class="toctree-l3"><a class="reference internal" href="../auth-config-ref/">认证选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mon-config-ref/">监视器选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mon-lookup-dns/">通过 DNS 查询监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mon-osd-interaction/">心跳选项（监视器与 OSD 的的交互）</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">OSD 选项</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#index-1">常规配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-2">文件系统选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-3">日志选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">监视器和 OSD 的交互</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id5">数据归置</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-4">洗刷</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-5">操作数</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-6">回填</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-7">OSD 运行图</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-8">恢复</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id13">分级缓存选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id14">杂项</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../mclock-config-ref/">DmClock 配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../bluestore-config-ref/">BlueStore 配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../filestore-config-ref/">FileStore 配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../journal-ref/">日志选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../pool-pg-config-ref/">存储池、归置组和 CRUSH 选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../general-config-ref/">常规选项</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../operations/">运维</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/">    手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="osd">
<h1>OSD 配置参考<a class="headerlink" href="#osd" title="Permalink to this headline">¶</a></h1>
<p id="index-0">你可以通过配置文件调整 OSD ，
（或者通过近期版本里的中央配置库）
但靠默认值和极少的配置 OSD 守护进程就能运行。
最简 OSD 配置需设置 <code class="docutils literal notranslate"><span class="pre">osd</span> <span class="pre">journal</span> <span class="pre">size</span></code> 和 <code class="docutils literal notranslate"><span class="pre">host</span></code> ，
其他几乎都能用默认值。</p>
<p>Ceph 的 OSD 守护进程用递增的数字作标识，
按惯例以 <code class="docutils literal notranslate"><span class="pre">0</span></code> 开始，如下：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">osd</span><span class="mf">.0</span>
<span class="n">osd</span><span class="mf">.1</span>
<span class="n">osd</span><span class="mf">.2</span>
</pre></div>
</div>
<p>在配置文件里， <code class="docutils literal notranslate"><span class="pre">[osd]</span></code> 段下的配置适用于所有 OSD ；
要添加针对特定 OSD 的选项（如 <code class="docutils literal notranslate"><span class="pre">host</span></code> ），
把它放到那个 OSD 段下即可，
如：</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[osd]</span>
        <span class="na">osd journal size</span> <span class="o">=</span> <span class="s">5120</span>

<span class="k">[osd.0]</span>
        <span class="na">host</span> <span class="o">=</span> <span class="s">osd-host-a</span>

<span class="k">[osd.1]</span>
        <span class="na">host</span> <span class="o">=</span> <span class="s">osd-host-b</span>
</pre></div>
</div>
<div class="section" id="index-1">
<span id="id1"></span><h2>常规配置<a class="headerlink" href="#index-1" title="Permalink to this headline">¶</a></h2>
<p>下列选项可配置一 OSD 的唯一标识符、以及数据和日志的路径。
Ceph 部署脚本通常会自动生成 UUID 。</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p><strong>不要</strong>更改数据和日志的默认路径，因为这样会增加后续的排障难度。</p>
</div>
<p>日志尺寸应该大于期望的驱动器速度和 <code class="docutils literal notranslate"><span class="pre">filestore</span> <span class="pre">max</span> <span class="pre">sync</span> <span class="pre">interval</span></code> 之乘积的两倍；
最常见的方法是为日志驱动器（通常是 SSD ）分区并挂载好，
这样 Ceph 就可以用整个分区做日志。</p>
<dl class="std confval">
<dt id="confval-osd_uuid">
<code class="sig-name descname"><span class="pre">osd_uuid</span></code><a class="headerlink" href="#confval-osd_uuid" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Ceph OSD 守护进程的全局唯一标识符（ UUID ）。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uuid</span></code></p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>配置选项 <code class="docutils literal notranslate"><span class="pre">osd_uuid</span></code> 适用于单个 OSD 守护进程， <code class="docutils literal notranslate"><span class="pre">fsid</span></code> 适用于整个集群。</p>
</div>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_data">
<code class="sig-name descname"><span class="pre">osd_data</span></code><a class="headerlink" href="#confval-osd_data" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>OSD 数据的路径。部署集群时，你必须创建此目录、 并把用于存储 OSD 数据的驱动器挂载到这个挂载点下。 我们不推荐更改默认值。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">/var/lib/ceph/osd/$cluster-$id</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_max_write_size">
<code class="sig-name descname"><span class="pre">osd_max_write_size</span></code><a class="headerlink" href="#confval-osd_max_write_size" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>一次写入的最大尺寸，MB。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">90B</span></code></p>
</dd>
<dt class="field-odd">min</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">4</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_max_object_size">
<code class="sig-name descname"><span class="pre">osd_max_object_size</span></code><a class="headerlink" href="#confval-osd_max_object_size" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>单个 RADOS 对象的最大尺寸，单位为字节。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">128Mi</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_client_message_size_cap">
<code class="sig-name descname"><span class="pre">osd_client_message_size_cap</span></code><a class="headerlink" href="#confval-osd_client_message_size_cap" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>内存里允许的客户端数据消息的最大尺寸。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">500Mi</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_class_dir">
<code class="sig-name descname"><span class="pre">osd_class_dir</span></code><a class="headerlink" href="#confval-osd_class_dir" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>RADOS 类插件的路径。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">$libdir/rados-classes</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</div>
<div class="section" id="index-2">
<span id="id2"></span><h2>文件系统选项<a class="headerlink" href="#index-2" title="Permalink to this headline">¶</a></h2>
<p>Ceph 可自动创建并挂载所需的文件系统。</p>
<p><code class="docutils literal notranslate"><span class="pre">osd_mkfs_options</span> <span class="pre">{fs-type}</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>为 OSD 新建 {fs-type} 类型的文件系统时使用的选项。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">xfs 默认值</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">-f</span> <span class="pre">-i</span> <span class="pre">2048</span></code></p>
</dd>
<dt class="field-even">其余文件系统默认值</dt>
<dd class="field-even"><p>{empty string}</p>
</dd>
</dl>
<p>例如:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>``osd_mkfs_options_xfs = -f -d agcount=24``
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">osd_mount_options</span> <span class="pre">{fs-type}</span></code></p>
<dl class="field-list simple">
<dt class="field-odd">描述</dt>
<dd class="field-odd"><p>挂载 {fs-type} 类型的文件系统作为 OSD 数据目录时所用的选项。</p>
</dd>
<dt class="field-even">类型</dt>
<dd class="field-even"><p>String</p>
</dd>
<dt class="field-odd">xfs 默认值</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">rw,noatime,inode64</span></code></p>
</dd>
<dt class="field-even">其余文件系统默认值</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">rw,</span> <span class="pre">noatime</span></code></p>
</dd>
</dl>
<p>例如:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>``osd_mount_options_xfs = rw, noatime, inode64, logbufs=8``
</pre></div>
</div>
</div>
<div class="section" id="index-3">
<span id="id3"></span><h2>日志选项<a class="headerlink" href="#index-3" title="Permalink to this headline">¶</a></h2>
<p>This section applies only to the older Filestore OSD back end.  Since Luminous
BlueStore has been default and preferred.</p>
<p>默认情况下， Ceph 希望你把 OSD 守护进程的日志放到如下路径，它通常是到一个设备或分区的符号链接:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>/var/lib/ceph/osd/$cluster-$id/journal
</pre></div>
</div>
<p>When using a single device type (for example, spinning drives), the journals
should be <em>colocated</em>: the logical volume (or partition) should be in the same
device as the <code class="docutils literal notranslate"><span class="pre">data</span></code> logical volume.</p>
<p>When using a mix of fast (SSDs, NVMe) devices with slower ones (like spinning
drives) it makes sense to place the journal on the faster device, while
<code class="docutils literal notranslate"><span class="pre">data</span></code> occupies the slower device fully.</p>
<p>The default <code class="docutils literal notranslate"><span class="pre">osd</span> <span class="pre">journal</span> <span class="pre">size</span></code> value is 5120 (5 gigabytes), but it can be
larger, in which case it will need to be set in the <code class="docutils literal notranslate"><span class="pre">ceph.conf</span></code> file:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">osd</span> <span class="n">journal</span> <span class="n">size</span> <span class="o">=</span> <span class="mi">10240</span>
</pre></div>
</div>
<dl class="std confval">
<dt id="confval-osd_journal">
<code class="sig-name descname"><span class="pre">osd_journal</span></code><a class="headerlink" href="#confval-osd_journal" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>OSD 日志路径，可以是一个文件或块设备（比如一个 SSD 分区）的路径。 如果是文件，要先给它创建相应的目录。 如果
<code class="docutils literal notranslate"><span class="pre">osd_data</span></code> 是个 HDD ， 我们建议用独立的高速设备。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">/var/lib/ceph/osd/$cluster-$id/journal</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_journal_size">
<code class="sig-name descname"><span class="pre">osd_journal_size</span></code><a class="headerlink" href="#confval-osd_journal_size" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>日志尺寸（ MB ）。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5Ki</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<p>详情见<a class="reference external" href="../journal-ref">日志配置参考</a>。</p>
</div>
<div class="section" id="id4">
<h2>监视器和 OSD 的交互<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<p>OSD 周期性地相互检查心跳并报告给监视器。 Ceph 默认配置可满足多数情况，但是如果你的网络延时大，就得用较长间隔。关于心跳的讨论参见<a class="reference external" href="../mon-osd-interaction">监视器与 OSD 交互的配置</a>。</p>
</div>
<div class="section" id="id5">
<h2>数据归置<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<p>详情见<a class="reference external" href="../pool-pg-config-ref">存储池和归置组配置参考</a>。</p>
</div>
<div class="section" id="index-4">
<span id="id6"></span><h2>洗刷<a class="headerlink" href="#index-4" title="Permalink to this headline">¶</a></h2>
<p>除了为对象复制多个副本外，
Ceph 还要洗刷归置组以确保数据完整性。
这种洗刷类似对象存储层的 <code class="docutils literal notranslate"><span class="pre">fsck</span></code> ，对每个归置组，
Ceph 生成一个所有对象的目录，并比对每个主对象及其副本以确保没有对象丢失或错配。
轻微洗刷（每天）检查对象尺寸和属性，
深层洗刷（每周）会读出数据并用校验和方法确认数据完整性。</p>
<p>洗刷对维护数据完整性很重要，但会导致性能下降；
你可以用下列选项来增加或减少洗刷操作。</p>
<dl class="std confval">
<dt id="confval-osd_max_scrubs">
<code class="sig-name descname"><span class="pre">osd_max_scrubs</span></code><a class="headerlink" href="#confval-osd_max_scrubs" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>一个 OSD 守护进程同时进行的最大洗刷操作数。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_begin_hour">
<code class="sig-name descname"><span class="pre">osd_scrub_begin_hour</span></code><a class="headerlink" href="#confval-osd_scrub_begin_hour" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>This restricts scrubbing to this hour of the day or later. Use
<code class="docutils literal notranslate"><span class="pre">osd_scrub_begin_hour</span> <span class="pre">=</span> <span class="pre">0</span></code> and <code class="docutils literal notranslate"><span class="pre">osd_scrub_end_hour</span> <span class="pre">=</span> <span class="pre">0</span></code> to allow
scrubbing the entire day.  Along with <code class="docutils literal notranslate"><span class="pre">osd_scrub_end_hour</span></code>, they
define a time window, in which the scrubs can happen. But a scrub will
be performed no matter whether the time window allows or not, as long
as the placement group’s scrub interval exceeds
<code class="docutils literal notranslate"><span class="pre">osd_scrub_max_interval</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
<dt class="field-odd">allowed range</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">23]</span></code></p>
</dd>
<dt class="field-even">see also</dt>
<dd class="field-even"><p><a class="reference internal" href="#confval-osd_scrub_end_hour"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_scrub_end_hour</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_end_hour">
<code class="sig-name descname"><span class="pre">osd_scrub_end_hour</span></code><a class="headerlink" href="#confval-osd_scrub_end_hour" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>本选项把洗刷操作限制在这个小时之前。 设置 <code class="docutils literal notranslate"><span class="pre">osd_scrub_begin_hour</span> <span class="pre">=</span> <span class="pre">0</span></code> 和
<code class="docutils literal notranslate"><span class="pre">osd_scrub_end_hour</span> <span class="pre">=</span> <span class="pre">0</span></code> 时， 整天都允许洗刷操作进行。本选项与
<code class="docutils literal notranslate"><span class="pre">osd_scrub_begin_hour</span></code> 一起 定义了一个时间窗口，在此期间可以进行洗刷操作。 但是，在某个归置组的洗刷间隔超过
<code class="docutils literal notranslate"><span class="pre">osd_scrub_max_interval</span></code> 时， 不管这个时间窗口是否合适都会执行。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
<dt class="field-odd">allowed range</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">23]</span></code></p>
</dd>
<dt class="field-even">see also</dt>
<dd class="field-even"><p><a class="reference internal" href="#confval-osd_scrub_begin_hour"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_scrub_begin_hour</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_begin_week_day">
<code class="sig-name descname"><span class="pre">osd_scrub_begin_week_day</span></code><a class="headerlink" href="#confval-osd_scrub_begin_week_day" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>This restricts scrubbing to this day of the week or later. 0  =
Sunday, 1 = Monday, etc. Use <code class="docutils literal notranslate"><span class="pre">osd_scrub_begin_week_day</span> <span class="pre">=</span> <span class="pre">0</span></code> and
<code class="docutils literal notranslate"><span class="pre">osd_scrub_end_week_day</span> <span class="pre">=</span> <span class="pre">0</span></code> to allow scrubbing for the entire week.
Along with <code class="docutils literal notranslate"><span class="pre">osd_scrub_end_week_day</span></code>, they define a time window in
which scrubs can happen. But a scrub will be performed no matter
whether the time window allows or not, when the PG’s scrub interval
exceeds <code class="docutils literal notranslate"><span class="pre">osd_scrub_max_interval</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
<dt class="field-odd">allowed range</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">6]</span></code></p>
</dd>
<dt class="field-even">see also</dt>
<dd class="field-even"><p><a class="reference internal" href="#confval-osd_scrub_end_week_day"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_scrub_end_week_day</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_end_week_day">
<code class="sig-name descname"><span class="pre">osd_scrub_end_week_day</span></code><a class="headerlink" href="#confval-osd_scrub_end_week_day" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>This restricts scrubbing to days of the week earlier than this. 0 =
Sunday, 1 = Monday, etc.  Use <code class="docutils literal notranslate"><span class="pre">osd_scrub_begin_week_day</span> <span class="pre">=</span> <span class="pre">0</span></code> and
<code class="docutils literal notranslate"><span class="pre">osd_scrub_end_week_day</span> <span class="pre">=</span> <span class="pre">0</span></code> to allow scrubbing for the entire week.
Along with <code class="docutils literal notranslate"><span class="pre">osd_scrub_begin_week_day</span></code>, they define a time window, in
which the scrubs can happen. But a scrub will be performed no matter
whether the time window allows or not, as long as the placement
group’s scrub interval exceeds <code class="docutils literal notranslate"><span class="pre">osd_scrub_max_interval</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
<dt class="field-odd">allowed range</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">6]</span></code></p>
</dd>
<dt class="field-even">see also</dt>
<dd class="field-even"><p><a class="reference internal" href="#confval-osd_scrub_begin_week_day"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_scrub_begin_week_day</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_during_recovery">
<code class="sig-name descname"><span class="pre">osd_scrub_during_recovery</span></code><a class="headerlink" href="#confval-osd_scrub_during_recovery" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>在恢复期间允许洗刷。有正在进行的恢复，且这里为 <code class="docutils literal notranslate"><span class="pre">false</span></code> 时， 就会禁止调度新的洗刷（和深层洗刷）。 已经在运行的洗刷不受影响。
对繁忙的集群来说，这样做可降低负载。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_load_threshold">
<code class="sig-name descname"><span class="pre">osd_scrub_load_threshold</span></code><a class="headerlink" href="#confval-osd_scrub_load_threshold" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>平常遇到的最大负载，当前系统负载（ <code class="docutils literal notranslate"><span class="pre">getloadavg()</span> <span class="pre">/</span> <span class="pre">在线</span> <span class="pre">CPU</span> <span class="pre">数量</span></code> 所定义的）高于此值时 Ceph 不会洗刷。
默认 <code class="docutils literal notranslate"><span class="pre">0.5</span></code> 。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.5</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_min_interval">
<code class="sig-name descname"><span class="pre">osd_scrub_min_interval</span></code><a class="headerlink" href="#confval-osd_scrub_min_interval" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Ceph 存储集群负载低的时候， 洗刷 OSD 守护进程的最小间隔时间，秒数。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span> <span class="pre">day</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_scrub_max_interval"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_scrub_max_interval</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_max_interval">
<code class="sig-name descname"><span class="pre">osd_scrub_max_interval</span></code><a class="headerlink" href="#confval-osd_scrub_max_interval" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>不论集群负载如何， 都要进行洗刷的最大时间间隔，秒数。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">7</span> <span class="pre">days</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_scrub_min_interval"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_scrub_min_interval</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_chunk_min">
<code class="sig-name descname"><span class="pre">osd_scrub_chunk_min</span></code><a class="headerlink" href="#confval-osd_scrub_chunk_min" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>单个操作可洗刷的最小对象块数。 数据块在洗刷期间， Ceph 会阻塞别人向它写入。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_scrub_chunk_max"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_scrub_chunk_max</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_chunk_max">
<code class="sig-name descname"><span class="pre">osd_scrub_chunk_max</span></code><a class="headerlink" href="#confval-osd_scrub_chunk_max" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>单个操作可洗刷的最大对象块数。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">25</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_scrub_chunk_min"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_scrub_chunk_min</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_sleep">
<code class="sig-name descname"><span class="pre">osd_scrub_sleep</span></code><a class="headerlink" href="#confval-osd_scrub_sleep" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>洗刷下一组数据块前等待的时间。 增加此值会拖慢整个洗刷进度，因而对客户端操作影响较小。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_deep_scrub_interval">
<code class="sig-name descname"><span class="pre">osd_deep_scrub_interval</span></code><a class="headerlink" href="#confval-osd_deep_scrub_interval" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>深层洗刷（完整地读取所有数据）的间隔时间。 <code class="docutils literal notranslate"><span class="pre">osd_scrub_load_threshold</span></code> 不影响此设置。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">7</span> <span class="pre">days</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_interval_randomize_ratio">
<code class="sig-name descname"><span class="pre">osd_scrub_interval_randomize_ratio</span></code><a class="headerlink" href="#confval-osd_scrub_interval_randomize_ratio" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>在给某一归置组调度下一个洗刷作业时， 给 <code class="docutils literal notranslate"><span class="pre">osd</span> <span class="pre">scrub</span> <span class="pre">min</span> <span class="pre">interval</span></code> 增加个随机延时， 这个延时是个小于
<code class="docutils literal notranslate"><span class="pre">osd</span> <span class="pre">scrub</span> <span class="pre">min</span> <span class="pre">interval</span></code> * <code class="docutils literal notranslate"><span class="pre">osd</span> <span class="pre">scrub</span> <span class="pre">interval</span> <span class="pre">randomized</span> <span class="pre">ratio</span></code>
的随机值。默认设置会把洗刷操作随机地散布到允许的时间窗口内， 即 <code class="docutils literal notranslate"><span class="pre">[1,</span> <span class="pre">1.5]</span></code> * <code class="docutils literal notranslate"><span class="pre">osd</span> <span class="pre">scrub</span> <span class="pre">min</span>
<span class="pre">interval</span></code> 。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.5</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_scrub_min_interval"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_scrub_min_interval</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_deep_scrub_stride">
<code class="sig-name descname"><span class="pre">osd_deep_scrub_stride</span></code><a class="headerlink" href="#confval-osd_deep_scrub_stride" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>深层洗刷时的读取尺寸。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">512Ki</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_auto_repair">
<code class="sig-name descname"><span class="pre">osd_scrub_auto_repair</span></code><a class="headerlink" href="#confval-osd_scrub_auto_repair" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Setting this to <code class="docutils literal notranslate"><span class="pre">true</span></code> will enable automatic PG repair when errors
are found by scrubs or deep-scrubs.  However, if more than
<code class="docutils literal notranslate"><span class="pre">osd_scrub_auto_repair_num_errors</span></code> errors are found a repair is NOT
performed.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_auto_repair_num_errors">
<code class="sig-name descname"><span class="pre">osd_scrub_auto_repair_num_errors</span></code><a class="headerlink" href="#confval-osd_scrub_auto_repair_num_errors" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Auto repair will not occur if more than this many errors are found.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_scrub_auto_repair"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_scrub_auto_repair</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</div>
<div class="section" id="index-5">
<span id="id7"></span><h2>操作数<a class="headerlink" href="#index-5" title="Permalink to this headline">¶</a></h2>
<dl class="std confval">
<dt id="confval-osd_op_num_shards">
<code class="sig-name descname"><span class="pre">osd_op_num_shards</span></code><a class="headerlink" href="#confval-osd_op_num_shards" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>The number of shards allocated for a given OSD. Each shard has its own
processing queue. PGs on the OSD are distributed evenly in the shard.
This setting overrides _ssd and _hdd if non-zero.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_op_num_shards_hdd">
<code class="sig-name descname"><span class="pre">osd_op_num_shards_hdd</span></code><a class="headerlink" href="#confval-osd_op_num_shards_hdd" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>the number of shards allocated for a given OSD (for rotational media).</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_num_shards"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_num_shards</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_op_num_shards_ssd">
<code class="sig-name descname"><span class="pre">osd_op_num_shards_ssd</span></code><a class="headerlink" href="#confval-osd_op_num_shards_ssd" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>the number of shards allocated for a given OSD (for solid state
media).</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">8</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_num_shards"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_num_shards</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_op_queue">
<code class="sig-name descname"><span class="pre">osd_op_queue</span></code><a class="headerlink" href="#confval-osd_op_queue" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>本选项用于配置要使用的队列类型，以排列 OSD 内各种操作（ ops ）的优先顺序。
两种队列都实现了严格子队列，出常规队列之前要先出子队列，它与常规队列的实现机制不同。 WeightedPriorityQueue
(<code class="docutils literal notranslate"><span class="pre">wpq</span></code>) 会根据其优先级处理所有队列， 以避免出现饥饿队列。在一部分 OSD 负载明显高于其它的时， WPQ 应该有优势。
mClockQueue (<code class="docutils literal notranslate"><span class="pre">mclock_scheduler</span></code>) 基于操作所属的类（ recovery 、 scrub 、
snaptrim 、 client op 、 osd subop ）来划分优先级。 见 <a class="reference internal" href="#mclock-qos">基于 mClock 的 QoS</a>。
此配置更改后需重启。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">mclock_scheduler</span></code></p>
</dd>
<dt class="field-odd">valid choices</dt>
<dd class="field-odd"><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">wpq</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">mclock_scheduler</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">debug_random</span></code></p></li>
</ul>
</dd>
<dt class="field-even">see also</dt>
<dd class="field-even"><p><a class="reference internal" href="#confval-osd_op_queue_cut_off"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue_cut_off</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_op_queue_cut_off">
<code class="sig-name descname"><span class="pre">osd_op_queue_cut_off</span></code><a class="headerlink" href="#confval-osd_op_queue_cut_off" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>本选项用于配置把哪个优先级的操作放入严格队列、 还是常规队列。 <code class="docutils literal notranslate"><span class="pre">low</span></code> 这个选项会把所有复制操作以及优先级更高的放入严格队列； 而
<code class="docutils literal notranslate"><span class="pre">high</span></code> 选项只会把复制的确认反馈操作以及优先级更高的发往严格队列。 此选项设置为 <code class="docutils literal notranslate"><span class="pre">high</span></code> 时，应该有助于缓解集群内某些
OSD 特别繁忙的情形， 尤其是配合 <code class="docutils literal notranslate"><span class="pre">osd</span> <span class="pre">op</span> <span class="pre">queue</span></code> 设置为 <code class="docutils literal notranslate"><span class="pre">wpq</span></code> 使用时效果更佳。 忙于处理副本流量的 OSD
们，如果没有这些配置， 它们的主副本（ primary client ）客户端往往比较空闲。 此配置更改后需重启。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">high</span></code></p>
</dd>
<dt class="field-odd">valid choices</dt>
<dd class="field-odd"><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">low</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">high</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">debug_random</span></code></p></li>
</ul>
</dd>
<dt class="field-even">see also</dt>
<dd class="field-even"><p><a class="reference internal" href="#confval-osd_op_queue"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_client_op_priority">
<code class="sig-name descname"><span class="pre">osd_client_op_priority</span></code><a class="headerlink" href="#confval-osd_client_op_priority" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>客户端操作的优先级组。 此值与下文的 <code class="docutils literal notranslate"><span class="pre">osd_recovery_op_priority</span></code> 相对。 默认值严重偏向客户端操作而非恢复。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">63</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_op_priority">
<code class="sig-name descname"><span class="pre">osd_recovery_op_priority</span></code><a class="headerlink" href="#confval-osd_recovery_op_priority" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>存储池没有配置 <code class="docutils literal notranslate"><span class="pre">recovery_op_priority</span></code> 的时候， 恢复操作相对于客户端操作的优先级，
采用默认值时，客户端操作（见上文）优先于恢复操作。 你可以瞅准时机，权衡对客户端的影响和恢复集群健康的重要性，适时调整，
降低此值会增大客户端操作的优先级、 或者增大它优先保证恢复。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">3</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_scrub_priority">
<code class="sig-name descname"><span class="pre">osd_scrub_priority</span></code><a class="headerlink" href="#confval-osd_scrub_priority" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>The default work queue priority for scheduled scrubs when the pool
doesn’t specify a value of <code class="docutils literal notranslate"><span class="pre">scrub_priority</span></code>.  This can be boosted to
the value of <code class="docutils literal notranslate"><span class="pre">osd_client_op_priority</span></code> when scrubs are blocking
client operations.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_requested_scrub_priority">
<code class="sig-name descname"><span class="pre">osd_requested_scrub_priority</span></code><a class="headerlink" href="#confval-osd_requested_scrub_priority" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>The priority set for user requested scrub on the work queue.  If this
value were to be smaller than <code class="docutils literal notranslate"><span class="pre">osd_client_op_priority</span></code> it can be
boosted to the value of <code class="docutils literal notranslate"><span class="pre">osd_client_op_priority</span></code> when scrub is
blocking client operations.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">120</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_snap_trim_priority">
<code class="sig-name descname"><span class="pre">osd_snap_trim_priority</span></code><a class="headerlink" href="#confval-osd_snap_trim_priority" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>快照修剪工作队列的优先级组。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_snap_trim_sleep">
<code class="sig-name descname"><span class="pre">osd_snap_trim_sleep</span></code><a class="headerlink" href="#confval-osd_snap_trim_sleep" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Time in seconds to sleep before next snap trim op. Increasing this
value will slow down snap trimming. This option overrides backend
specific variants.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_snap_trim_sleep_hdd">
<code class="sig-name descname"><span class="pre">osd_snap_trim_sleep_hdd</span></code><a class="headerlink" href="#confval-osd_snap_trim_sleep_hdd" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Time in seconds to sleep before next snap trim for HDDs</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_snap_trim_sleep_ssd">
<code class="sig-name descname"><span class="pre">osd_snap_trim_sleep_ssd</span></code><a class="headerlink" href="#confval-osd_snap_trim_sleep_ssd" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Time in seconds to sleep before next snap trim op for SSD OSDs
(including NVMe).</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_snap_trim_sleep_hybrid">
<code class="sig-name descname"><span class="pre">osd_snap_trim_sleep_hybrid</span></code><a class="headerlink" href="#confval-osd_snap_trim_sleep_hybrid" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Time in seconds to sleep before next snap trim op when OSD data is on
an HDD and the OSD journal or WAL+DB is on an SSD.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">2.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_op_thread_timeout">
<code class="sig-name descname"><span class="pre">osd_op_thread_timeout</span></code><a class="headerlink" href="#confval-osd_op_thread_timeout" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>OSD 守护进程操作线程的超时秒数。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">15</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_op_complaint_time">
<code class="sig-name descname"><span class="pre">osd_op_complaint_time</span></code><a class="headerlink" href="#confval-osd_op_complaint_time" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>一个操作进行多久后可以开始抱怨。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">30.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_op_history_size">
<code class="sig-name descname"><span class="pre">osd_op_history_size</span></code><a class="headerlink" href="#confval-osd_op_history_size" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>要跟踪的已完成操作的最大数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">20</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_op_history_duration">
<code class="sig-name descname"><span class="pre">osd_op_history_duration</span></code><a class="headerlink" href="#confval-osd_op_history_duration" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>要跟踪的、最老的已完成操作。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">600</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_op_log_threshold">
<code class="sig-name descname"><span class="pre">osd_op_log_threshold</span></code><a class="headerlink" href="#confval-osd_op_log_threshold" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>一次显示多少操作日志。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<div class="section" id="mclock-qos">
<span id="dmclock-qos"></span><h3>基于 mClock 的 QoS<a class="headerlink" href="#mclock-qos" title="Permalink to this headline">¶</a></h3>
<p>现在， Ceph 对 mClock 的应用更精致了，可以按照 <a class="reference external" href="../mclock-config-ref">mClock 配置参考</a> 里的步骤使用。</p>
<div class="section" id="id8">
<h4>核心概念<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h4>
<p>Ceph’s QoS support is implemented using a queueing scheduler
based on <a class="reference external" href="https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Gulati.pdf">the dmClock algorithm</a>. This algorithm allocates the I/O
resources of the Ceph cluster in proportion to weights, and enforces
the constraints of minimum reservation and maximum limitation, so that
the services can compete for the resources fairly. Currently the
<em>mclock_scheduler</em> operation queue divides Ceph services involving I/O
resources into following buckets:</p>
<ul class="simple">
<li><p>client op: the iops issued by client</p></li>
<li><p>osd subop: the iops issued by primary OSD</p></li>
<li><p>snap trim: the snap trimming related requests</p></li>
<li><p>pg recovery: the recovery related requests</p></li>
<li><p>pg scrub: the scrub related requests</p></li>
</ul>
<p>And the resources are partitioned using following three sets of tags. In other
words, the share of each type of service is controlled by three tags:</p>
<ol class="arabic simple">
<li><p>reservation: the minimum IOPS allocated for the service.</p></li>
<li><p>limitation: the maximum IOPS allocated for the service.</p></li>
<li><p>weight: the proportional share of capacity if extra capacity or system
oversubscribed.</p></li>
</ol>
<p>In Ceph, operations are graded with “cost”. And the resources allocated
for serving various services are consumed by these “costs”. So, for
example, the more reservation a services has, the more resource it is
guaranteed to possess, as long as it requires. Assuming there are 2
services: recovery and client ops:</p>
<ul class="simple">
<li><p>recovery: (r:1, l:5, w:1)</p></li>
<li><p>client ops: (r:2, l:0, w:9)</p></li>
</ul>
<p>The settings above ensure that the recovery won’t get more than 5
requests per second serviced, even if it requires so (see CURRENT
IMPLEMENTATION NOTE below), and no other services are competing with
it. But if the clients start to issue large amount of I/O requests,
neither will they exhaust all the I/O resources. 1 request per second
is always allocated for recovery jobs as long as there are any such
requests. So the recovery jobs won’t be starved even in a cluster with
high load. And in the meantime, the client ops can enjoy a larger
portion of the I/O resource, because its weight is “9”, while its
competitor “1”. In the case of client ops, it is not clamped by the
limit setting, so it can make use of all the resources if there is no
recovery ongoing.</p>
<p>CURRENT IMPLEMENTATION NOTE: the current implementation enforces the limit
values. Therefore, if a service crosses the enforced limit, the op remains
in the operation queue until the limit is restored.</p>
</div>
<div class="section" id="mclock">
<h4>mClock 的精妙之处<a class="headerlink" href="#mclock" title="Permalink to this headline">¶</a></h4>
<p>The reservation and limit values have a unit of requests per
second. The weight, however, does not technically have a unit and the
weights are relative to one another. So if one class of requests has a
weight of 1 and another a weight of 9, then the latter class of
requests should get 9 executed at a 9 to 1 ratio as the first class.
However that will only happen once the reservations are met and those
values include the operations executed under the reservation phase.</p>
<p>Even though the weights do not have units, one must be careful in
choosing their values due how the algorithm assigns weight tags to
requests. If the weight is <em>W</em>, then for a given class of requests,
the next one that comes in will have a weight tag of <em>1/W</em> plus the
previous weight tag or the current time, whichever is larger. That
means if <em>W</em> is sufficiently large and therefore <em>1/W</em> is sufficiently
small, the calculated tag may never be assigned as it will get a value
of the current time. The ultimate lesson is that values for weight
should not be too large. They should be under the number of requests
one expects to be serviced each second.</p>
</div>
<div class="section" id="id9">
<h4>注意事项<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h4>
<p>There are some factors that can reduce the impact of the mClock op
queues within Ceph. First, requests to an OSD are sharded by their
placement group identifier. Each shard has its own mClock queue and
these queues neither interact nor share information among them. The
number of shards can be controlled with the configuration options
<a class="reference internal" href="#confval-osd_op_num_shards"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_num_shards</span></code></a>, <a class="reference internal" href="#confval-osd_op_num_shards_hdd"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_num_shards_hdd</span></code></a>, and
<a class="reference internal" href="#confval-osd_op_num_shards_ssd"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_num_shards_ssd</span></code></a>. A lower number of shards will increase the
impact of the mClock queues, but may have other deleterious effects.</p>
<p>Second, requests are transferred from the operation queue to the
operation sequencer, in which they go through the phases of
execution. The operation queue is where mClock resides and mClock
determines the next op to transfer to the operation sequencer. The
number of operations allowed in the operation sequencer is a complex
issue. In general we want to keep enough operations in the sequencer
so it’s always getting work done on some operations while it’s waiting
for disk and network access to complete on other operations. On the
other hand, once an operation is transferred to the operation
sequencer, mClock no longer has control over it. Therefore to maximize
the impact of mClock, we want to keep as few operations in the
operation sequencer as possible. So we have an inherent tension.</p>
<p>The configuration options that influence the number of operations in
the operation sequencer are <a class="reference internal" href="../bluestore-config-ref/#confval-bluestore_throttle_bytes"><code class="xref std std-confval docutils literal notranslate"><span class="pre">bluestore_throttle_bytes</span></code></a>,
<a class="reference internal" href="../bluestore-config-ref/#confval-bluestore_throttle_deferred_bytes"><code class="xref std std-confval docutils literal notranslate"><span class="pre">bluestore_throttle_deferred_bytes</span></code></a>,
<a class="reference internal" href="../bluestore-config-ref/#confval-bluestore_throttle_cost_per_io"><code class="xref std std-confval docutils literal notranslate"><span class="pre">bluestore_throttle_cost_per_io</span></code></a>,
<a class="reference internal" href="../bluestore-config-ref/#confval-bluestore_throttle_cost_per_io_hdd"><code class="xref std std-confval docutils literal notranslate"><span class="pre">bluestore_throttle_cost_per_io_hdd</span></code></a>, and
<a class="reference internal" href="../bluestore-config-ref/#confval-bluestore_throttle_cost_per_io_ssd"><code class="xref std std-confval docutils literal notranslate"><span class="pre">bluestore_throttle_cost_per_io_ssd</span></code></a>.</p>
<p>A third factor that affects the impact of the mClock algorithm is that
we’re using a distributed system, where requests are made to multiple
OSDs and each OSD has (can have) multiple shards. Yet we’re currently
using the mClock algorithm, which is not distributed (note: dmClock is
the distributed version of mClock).</p>
<p>Various organizations and individuals are currently experimenting with
mClock as it exists in this code base along with their modifications
to the code base. We hope you’ll share you’re experiences with your
mClock and dmClock experiments on the <code class="docutils literal notranslate"><span class="pre">ceph-devel</span></code> mailing list.</p>
<dl class="std confval">
<dt id="confval-osd_async_recovery_min_cost">
<code class="sig-name descname"><span class="pre">osd_async_recovery_min_cost</span></code><a class="headerlink" href="#confval-osd_async_recovery_min_cost" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>A mixture measure of number of current log entries difference and
historical missing objects,  above which we switch to use asynchronous
recovery when appropriate</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">100</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_push_per_object_cost">
<code class="sig-name descname"><span class="pre">osd_push_per_object_cost</span></code><a class="headerlink" href="#confval-osd_push_per_object_cost" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>the overhead for serving a push op</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1000B</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_mclock_scheduler_client_res">
<code class="sig-name descname"><span class="pre">osd_mclock_scheduler_client_res</span></code><a class="headerlink" href="#confval-osd_mclock_scheduler_client_res" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>IO proportion reserved for each client (default).</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_queue"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_mclock_scheduler_client_wgt">
<code class="sig-name descname"><span class="pre">osd_mclock_scheduler_client_wgt</span></code><a class="headerlink" href="#confval-osd_mclock_scheduler_client_wgt" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>IO share for each client (default) over reservation.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_queue"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_mclock_scheduler_client_lim">
<code class="sig-name descname"><span class="pre">osd_mclock_scheduler_client_lim</span></code><a class="headerlink" href="#confval-osd_mclock_scheduler_client_lim" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>IO limit for each client (default) over reservation.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">999999</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_queue"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_mclock_scheduler_background_recovery_res">
<code class="sig-name descname"><span class="pre">osd_mclock_scheduler_background_recovery_res</span></code><a class="headerlink" href="#confval-osd_mclock_scheduler_background_recovery_res" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>IO proportion reserved for background recovery (default).</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_queue"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_mclock_scheduler_background_recovery_wgt">
<code class="sig-name descname"><span class="pre">osd_mclock_scheduler_background_recovery_wgt</span></code><a class="headerlink" href="#confval-osd_mclock_scheduler_background_recovery_wgt" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>IO share for each background recovery over reservation.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_queue"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_mclock_scheduler_background_recovery_lim">
<code class="sig-name descname"><span class="pre">osd_mclock_scheduler_background_recovery_lim</span></code><a class="headerlink" href="#confval-osd_mclock_scheduler_background_recovery_lim" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>IO limit for background recovery over reservation.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">999999</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_queue"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_mclock_scheduler_background_best_effort_res">
<code class="sig-name descname"><span class="pre">osd_mclock_scheduler_background_best_effort_res</span></code><a class="headerlink" href="#confval-osd_mclock_scheduler_background_best_effort_res" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>IO proportion reserved for background best_effort (default).</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_queue"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_mclock_scheduler_background_best_effort_wgt">
<code class="sig-name descname"><span class="pre">osd_mclock_scheduler_background_best_effort_wgt</span></code><a class="headerlink" href="#confval-osd_mclock_scheduler_background_best_effort_wgt" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>IO share for each background best_effort over reservation.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_queue"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_mclock_scheduler_background_best_effort_lim">
<code class="sig-name descname"><span class="pre">osd_mclock_scheduler_background_best_effort_lim</span></code><a class="headerlink" href="#confval-osd_mclock_scheduler_background_best_effort_lim" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>IO limit for background best_effort over reservation.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">999999</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_op_queue"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_op_queue</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</div>
</div>
</div>
<div class="section" id="index-6">
<span id="id10"></span><h2>回填<a class="headerlink" href="#index-6" title="Permalink to this headline">¶</a></h2>
<p>当集群新增或移除 OSD 时，按照 CRUSH 算法应该重新均衡集群，
它会把一些归置组移出或移入多个 OSD 以回到均衡状态。
归置组和对象的迁移会导致集群运营性能显著降低，为维持运营性能，
Ceph 用 backfilling 来执行此迁移，
它可以使得 Ceph 的回填操作优先级低于用户读写请求。</p>
<dl class="std confval">
<dt id="confval-osd_max_backfills">
<code class="sig-name descname"><span class="pre">osd_max_backfills</span></code><a class="headerlink" href="#confval-osd_max_backfills" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>单个 OSD 允许的最大回填操作数，写入和读出都算。 注意，此选项对读取和写入操作的限制是分别应用的。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_backfill_scan_min">
<code class="sig-name descname"><span class="pre">osd_backfill_scan_min</span></code><a class="headerlink" href="#confval-osd_backfill_scan_min" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>回填操作每次扫描对象的最大数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">64</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_backfill_scan_max">
<code class="sig-name descname"><span class="pre">osd_backfill_scan_max</span></code><a class="headerlink" href="#confval-osd_backfill_scan_max" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>回填操作每次扫描对象的最大数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">512</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_backfill_retry_interval">
<code class="sig-name descname"><span class="pre">osd_backfill_retry_interval</span></code><a class="headerlink" href="#confval-osd_backfill_retry_interval" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>重试回填请求前等待的秒数。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">30.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</div>
<div class="section" id="index-7">
<span id="id11"></span><h2>OSD 运行图<a class="headerlink" href="#index-7" title="Permalink to this headline">¶</a></h2>
<p>OSD 运行图反映集群中运行的 OSD 守护进程，斗转星移，图元增加。
Ceph 用一些选项来确保 OSD 运行图增大时仍运行良好。</p>
<dl class="std confval">
<dt id="confval-osd_map_dedup">
<code class="sig-name descname"><span class="pre">osd_map_dedup</span></code><a class="headerlink" href="#confval-osd_map_dedup" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>允许删除 OSD 图里的重复项。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_map_cache_size">
<code class="sig-name descname"><span class="pre">osd_map_cache_size</span></code><a class="headerlink" href="#confval-osd_map_cache_size" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>缓存中保留 OSD 图的个数。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">50</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_map_message_max">
<code class="sig-name descname"><span class="pre">osd_map_message_max</span></code><a class="headerlink" href="#confval-osd_map_message_max" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>每条 MOSDMap 消息允许的最大 map 条目数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">40</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</div>
<div class="section" id="index-8">
<span id="id12"></span><h2>恢复<a class="headerlink" href="#index-8" title="Permalink to this headline">¶</a></h2>
<p>当集群启动、或某 OSD 守护进程崩溃后重启时，此 OSD 开始与其它 OSD 们建立连接，这样才能正常工作。详情见<a class="reference external" href="../../operations/monitoring-osd-pg#peering">监控 OSD 和归置组</a>。</p>
<p>如果某 OSD 崩溃并重生，通常会落后于其他 OSD ，也就是没有同归置组内最新版本的对象。这时， OSD 守护进程进入恢复模式并检索最新数据副本，并更新运行图。根据 OSD 挂的时间长短， OSD 的对象和归置组可能落后得厉害，另外，如果挂的是一个失效域（如一个机柜），多个 OSD 会同时重生，这样恢复时间更长、更耗资源。</p>
<p>为保持运营性能， Ceph 进行恢复时会限制恢复请求数、线程数、对象块尺寸，这样在降级状态下也能保持良好的性能。</p>
<dl class="std confval">
<dt id="confval-osd_recovery_delay_start">
<code class="sig-name descname"><span class="pre">osd_recovery_delay_start</span></code><a class="headerlink" href="#confval-osd_recovery_delay_start" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>对等关系建立完毕后， Ceph 会延迟指定的秒数、 再开始恢复 RADOS 对象。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_max_active">
<code class="sig-name descname"><span class="pre">osd_recovery_max_active</span></code><a class="headerlink" href="#confval-osd_recovery_max_active" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>每个 OSD 一次可以处理的活跃恢复请求数量， 增大此值能加速恢复， 但这些请求会增大集群负载。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_recovery_max_active_hdd"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_recovery_max_active_hdd</span></code></a>, <a class="reference internal" href="#confval-osd_recovery_max_active_ssd"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_recovery_max_active_ssd</span></code></a></p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>只有在此值不是 0 的时候才会被采用。 通常它都是 <code class="docutils literal notranslate"><span class="pre">0</span></code> ，意思是 会采用 <code class="docutils literal notranslate"><span class="pre">hdd</span></code> 或 <code class="docutils literal notranslate"><span class="pre">ssd</span></code> 的值（在下文）， 取决于 OSD 后端主设备的类型。</p>
</div>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_max_active_hdd">
<code class="sig-name descname"><span class="pre">osd_recovery_max_active_hdd</span></code><a class="headerlink" href="#confval-osd_recovery_max_active_hdd" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>The number of active recovery requests per OSD at one time, if the
primary device is rotational.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">3</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_recovery_max_active"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_recovery_max_active</span></code></a>, <a class="reference internal" href="#confval-osd_recovery_max_active_ssd"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_recovery_max_active_ssd</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_max_active_ssd">
<code class="sig-name descname"><span class="pre">osd_recovery_max_active_ssd</span></code><a class="headerlink" href="#confval-osd_recovery_max_active_ssd" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>The number of active recovery requests per OSD at one time, if the
primary device is non-rotational (i.e., an SSD).</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_recovery_max_active"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_recovery_max_active</span></code></a>, <a class="reference internal" href="#confval-osd_recovery_max_active_hdd"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_recovery_max_active_hdd</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_max_chunk">
<code class="sig-name descname"><span class="pre">osd_recovery_max_chunk</span></code><a class="headerlink" href="#confval-osd_recovery_max_chunk" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>一次恢复操作可处理的数据块的最大总尺寸。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">8Mi</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_max_single_start">
<code class="sig-name descname"><span class="pre">osd_recovery_max_single_start</span></code><a class="headerlink" href="#confval-osd_recovery_max_single_start" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>一个 OSD 恢复时， 各个 OSD 即将新开恢复操作的最大数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recover_clone_overlap">
<code class="sig-name descname"><span class="pre">osd_recover_clone_overlap</span></code><a class="headerlink" href="#confval-osd_recover_clone_overlap" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>在数据恢复期间保留重叠副本。 应该总是 <code class="docutils literal notranslate"><span class="pre">true</span></code> 。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_sleep">
<code class="sig-name descname"><span class="pre">osd_recovery_sleep</span></code><a class="headerlink" href="#confval-osd_recovery_sleep" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>下一轮恢复或回填操作前睡眠的时间，单位为秒。 增大此值会减慢恢复操作，与此同时客户端操作受到的影响也小些了。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_sleep_hdd">
<code class="sig-name descname"><span class="pre">osd_recovery_sleep_hdd</span></code><a class="headerlink" href="#confval-osd_recovery_sleep_hdd" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>对于机械硬盘，下一轮恢复或回填操作前睡眠的时间， 单位为秒。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.1</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_sleep_ssd">
<code class="sig-name descname"><span class="pre">osd_recovery_sleep_ssd</span></code><a class="headerlink" href="#confval-osd_recovery_sleep_ssd" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>对于 SSD ，下一轮恢复或回填操作前睡眠的时间， 单位为秒。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.0</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_recovery_sleep"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_recovery_sleep</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_sleep_hybrid">
<code class="sig-name descname"><span class="pre">osd_recovery_sleep_hybrid</span></code><a class="headerlink" href="#confval-osd_recovery_sleep_hybrid" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>OSD 数据在机械硬盘上而 OSD 日志、WAL+DB 在固态硬盘上时， 下一轮恢复或回填操作前睡眠的时间，单位为秒。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.025</span></code></p>
</dd>
<dt class="field-odd">see also</dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_recovery_sleep"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_recovery_sleep</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_recovery_priority">
<code class="sig-name descname"><span class="pre">osd_recovery_priority</span></code><a class="headerlink" href="#confval-osd_recovery_priority" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>给恢复工作队列设置的默认优先级。与存储池的 <code class="docutils literal notranslate"><span class="pre">recovery_priority</span></code> 无关。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</div>
<div class="section" id="id13">
<h2>分级缓存选项<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h2>
<dl class="std confval">
<dt id="confval-osd_agent_max_ops">
<code class="sig-name descname"><span class="pre">osd_agent_max_ops</span></code><a class="headerlink" href="#confval-osd_agent_max_ops" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>在高速模式下， 每个分级缓存代理同时执行刷回操作的最大数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">4</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_agent_max_low_ops">
<code class="sig-name descname"><span class="pre">osd_agent_max_low_ops</span></code><a class="headerlink" href="#confval-osd_agent_max_low_ops" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>在低速模式下， 每个分级缓存代理同时执行刷回操作的最大数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">2</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<p>关于在高速模式下，分级缓存代理何时刷回脏对象，见 <a class="reference external" href="../../operations/pools#cache-target-dirty-high-ratio">cache target dirty high ratio</a> 选项。</p>
</div>
<div class="section" id="id14">
<h2>杂项<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h2>
<dl class="std confval">
<dt id="confval-osd_default_notify_timeout">
<code class="sig-name descname"><span class="pre">osd_default_notify_timeout</span></code><a class="headerlink" href="#confval-osd_default_notify_timeout" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>OSD 默认通告超时，秒。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">30</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_check_for_log_corruption">
<code class="sig-name descname"><span class="pre">osd_check_for_log_corruption</span></code><a class="headerlink" href="#confval-osd_check_for_log_corruption" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>检查日志文件看是否有数据损坏，会耗费大量计算时间。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_delete_sleep">
<code class="sig-name descname"><span class="pre">osd_delete_sleep</span></code><a class="headerlink" href="#confval-osd_delete_sleep" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Time in seconds to sleep before the next removal transaction. This
throttles the PG deletion process.</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_delete_sleep_hdd">
<code class="sig-name descname"><span class="pre">osd_delete_sleep_hdd</span></code><a class="headerlink" href="#confval-osd_delete_sleep_hdd" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Time in seconds to sleep before next removal transaction for HDDs</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_delete_sleep_ssd">
<code class="sig-name descname"><span class="pre">osd_delete_sleep_ssd</span></code><a class="headerlink" href="#confval-osd_delete_sleep_ssd" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Time in seconds to sleep before next removal transaction for SSDs</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_delete_sleep_hybrid">
<code class="sig-name descname"><span class="pre">osd_delete_sleep_hybrid</span></code><a class="headerlink" href="#confval-osd_delete_sleep_hybrid" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Time in seconds to sleep before next removal transaction when OSD data
is on HDD and OSD journal or WAL+DB is on SSD</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_command_max_records">
<code class="sig-name descname"><span class="pre">osd_command_max_records</span></code><a class="headerlink" href="#confval-osd_command_max_records" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>限制返回的丢失对象数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">256</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt id="confval-osd_fast_fail_on_connection_refused">
<code class="sig-name descname"><span class="pre">osd_fast_fail_on_connection_refused</span></code><a class="headerlink" href="#confval-osd_fast_fail_on_connection_refused" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>如果启用此选项，崩溃的 OSD 会即刻被已互联的 OSD 和监视器们标记为 down （假设已崩溃 OSD 所在的主机还活着）。
禁用此选项即可恢复原来的行为，代价是 I/O 操作中途若有 OSD 崩溃可能会导致较长时间的 I/O 卡顿。</p>
<dl class="field-list simple">
<dt class="field-odd">type</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">true</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../mclock-config-ref/" class="btn btn-neutral float-right" title="mClock Config Reference" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../mon-osd-interaction/" class="btn btn-neutral float-left" title="监视器与 OSD 交互的配置" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>